import com.woniuxy.bean.User;
import com.woniuxy.service.IUserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class test1 {
        public static void main(String[] args) {
                //findAll();
                ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
                IUserService userService = applicationContext.getBean("userService",IUserService.class);
                User user = applicationContext.getBean("user", User.class);
                /*添加*/
                //userService.add(user);
                /*删除*/
                //userService.deleteById(1);
                /*修改*/
                //user = userService.findId(6);
                //userService.updateById(user);
                /*查询*/
                List<User> users = userService.findAll();
                users.forEach(System.out::println);
        }
}
